The present invention relates to the field of and software debugging, more particularly, to assisting debug memory tracing using an instruction array that tracks the addresses of instructions modifying user specified objects.
Today's software programs are becoming increasingly sophisticated and complex. As a result, unexpected program termination, sometimes referred to as a crash, is not an uncommon occurrence. A common cause of crashes is result of memory errors often called access violations. These errors occur when program variables and/or objects loaded in memory become corrupt, are uninitialized, or are populated incorrectly. When a program crashes, a core file can be generated containing vital information about the program's state at the time of failure. While this does provide a window into the cause of the problem, debugging the problem can still be quite a frustrating process. Often it is difficult or infeasible to reproduce the condition which produced the crash, resulting in a complex mystery. Many times the only information that is available is the name and location of the variable or object that the access violation occurred on and addresses of functions/objects/pointers present in the program. As a result, most of the effort of analysis is in debug code to find where an incorrect object set occurs.
In C programs, structures are a frequently used data type which can have multiple member entities. These entities can be modified by functions within the program during execution. Often times, when the program fails, a structure member has been incorrectly set by a function (e.g. instruction). After the crash happens, it can be extremely difficult to determine which function modifying the structure member resulted in the crash. Debugging programs requires tracing memory addresses of instructions and/or pointers to a point of failure. Many times functions are accessed by pointers which have different addresses from the functions. Consequently, the debugging process is often reduced to following a breadcrumb trail of pointers and function addresses until the offending instruction is found. This process is inefficient and does not perform well in environments requiring rapid solutions.